From: Sebastian Keller Date: Fri, 13 Mar 2026 00:27:29 +0000 (+0100) Subject: systemActions: Fix initial visibility of logout action X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~26^2~1^2~7 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6f5f3c1f18a3597df04f831d4a8e1cdba2c0ecea;p=gnome-shell.git systemActions: Fix initial visibility of logout action When `_updateLogout()` is called on login, the AccountsService user might not have been loaded yet. This would have resulted in all values being null/false, including `local_account`. Since `!localAccount` is one of the cases where the action is available, this would have wrongly resulted in the item being shown when not intended to be shown. But only until something triggers another call of `_updateLogout()`, such as locking/unlocking the session. Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/9100 Part-of: --- diff --git a/js/misc/systemActions.js b/js/misc/systemActions.js index db559bfc2..75bada6a1 100644 --- a/js/misc/systemActions.js +++ b/js/misc/systemActions.js @@ -176,6 +176,10 @@ const SystemActions = GObject.registerClass({ this._userManager.connect('user-removed', () => this._updateMultiUser()); + this._user = this._userManager.get_user(GLib.get_user_name()); + + this._user.connect('notify::is-loaded', () => this._updateLogout()); + this._lockdownSettings.connect(`changed::${DISABLE_USER_SWITCH_KEY}`, () => this._updateSwitchUser()); this._lockdownSettings.connect(`changed::${DISABLE_LOG_OUT_KEY}`, @@ -434,12 +438,9 @@ const SystemActions = GObject.registerClass({ } _updateLogout() { - const user = this._userManager.get_user(GLib.get_user_name()); - const allowLogout = !this._lockdownSettings.get_boolean(DISABLE_LOG_OUT_KEY); const alwaysShow = global.settings.get_boolean(ALWAYS_SHOW_LOG_OUT_KEY); - const systemAccount = user.system_account; - const localAccount = user.local_account; + const {systemAccount, localAccount} = this._user; const multiUser = this._userManager.has_multiple_users; const multiSession = Gdm.get_session_ids().length > 1; const shouldShowInMode = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;